#include "stdafx.h"
#include "CppUnitTest.h"

#include <Do/Base/ArithmeticArray.h>
#include <Do/Real.h>


using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace UnitTests
{
	TEST_CLASS(Do_Array_Tests)
	{
	public:
		
		TEST_METHOD(Test_Constructor)
		{
			Do::ArithmeticArray<float, 3> a; a;
      Assert::AreEqual(a.size(), size_t(3));

      Do::ArithmeticArray<float, 3> b(0); b;
      Assert::AreEqual(a.size(), size_t(3));
		}
		
		TEST_METHOD(Test_quad)
		{
			Do::ArithmeticArray<float, 3> a(0); a;
      Assert::AreEqual(a.quad(), 0.0f);
		}
		
		TEST_METHOD(Test_length)
		{
			Do::ArithmeticArray<float, 3> a(0); a;
      Assert::AreEqual(a.length(), 0.0f);
		}
		
		TEST_METHOD(Test_normalize)
		{
			Do::ArithmeticArray<float, 3> a(1.1f); a;
      a.normalize();
      Assert::IsTrue(Do::Real<float>(a.length()).eq(1.0f));
		}

	};
}